<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background: red;
            position: absolute;
            left: 0;top:0;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <button id="btn">开始</button>
</body>
<script src="../jquery.js"></script>
<script>
    $("#btn")[0].onclick = function(){
        // 参数1：目标；参数2：时间；参数3：结束后的回调
        $(".box").animate({
            // width:0,
            // left:50,
            // height:0,
            // top:50
        }, 2000, function(){
            alert("结束了")
        })
    }
</script>
</html>